import 'package:flutter/material.dart';
import 'package:flutter_module/common/widget/skeleton/base_skeleton.dart';

import 'list_tile_skeleton.dart';

/// Create by kyluzoi
/// Date: 2021-08-17
///
/// Description: 文章页骨架
///

class ContentPageSkeleton extends BaseSkeletonWidget {
  ContentPageSkeleton({
    Key? key,
  }) : super(key: key, style: const SkeletonStyle.origin());

  @override
  _ContentPageSkeletonState createState() => _ContentPageSkeletonState();

  @override
  buildState() {
    return _ContentPageSkeletonState();
  }
}

class _ContentPageSkeletonState extends BaseSkeletonState<ContentPageSkeleton> {
  _createItem() {
    return Container(
      margin: EdgeInsets.all(5),
      width: double.infinity,
      height: 10,
      decoration: createSkeletonDecoration(false),
    );
  }

  @override
  Widget renderContainer() {
    return Column(
      children: [
        _createBanner(),
        for (int i = 0; i < 20; i++) _createItem()],
    );
  }

  _createBanner() {
    return Container(
      margin: EdgeInsets.only(left: 5,right: 5,bottom: 20,top: 10),
      width: double.infinity,
      height: 120,
      decoration: createSkeletonDecoration(false),
    );
  }
}
